<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <link rel="shortcut icon" href="../favicon.ico">
    <title>圣诞元旦好礼不断</title>

    <link rel="stylesheet" href="../../../../assets/css/home-animate.css">
    <style type="text/css">
        html,
        body {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
            font-size: 100%;
            background-color: #fff1da;
        }
        
        .christmas-poster {
            position: absolute;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
        }
        
        .poster {
            height: 100%;
            width: 100%;
            border-style: none;
        }
    </style>
</head>

<body>
    <div class="christmas-poster">
        <img class="poster" src="../../../../assets/image/prize_home_bg-20171224.jpg">
        <span class="sprite_global"></span>
    </div>

    <div class="operation-guide">
        <!-- <span>点击进入表单填写</span> -->
        <!-- <span class="shine">点击进入表单填写页面</span> -->
        <p class="shine">[ 点击进入表单填写页面 ]</p>
    </div>

    <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.js"></script>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js" type="text/javascript"></script>
    <script src="../../../../assets/js/social_share.v2.js" type="text/javascript" charset="utf-8"></script>

    <script type="text/javascript">
        $('body').bind('touchmove', function(ev) {
            ev.preventDefault();
        });

        $("*").dblclick(function(e) {
            e.preventDefault();
        });


        jQuery(document).ready(function($) {
            if (window.history && window.history.pushState) {
                // window.history.pushState('forward', null, '/pana-campaigns/pages/portal.html');
                window.history.pushState('forward', null, location.href.split('#')[0]);
                $(window).on('popstate', function() {
                    console.log('Back button was pressed.');
                    // window.location = "/pana-campaigns/pages/portal-20171224.html?v=" + Math.random().toString(36).substring(7);
                    window.location = "/pana-campaigns/pages/portal.html?v=" + Math.random().toString(36).substring(7);
                });
            }
        });

        var counter = 0;

        var gotoFormPage = function() {
            window.location = "/pana-campaigns/pages/campaigns/prize-cashing/2017-12-24/form.html";
        };

        $(".christmas-poster").click(gotoFormPage);
        $(".operation-guide").click(gotoFormPage);

        $(window).load(function() {
            // 获取 uuid
            $.get("/pana-BE-RESTful/prize/uuid", function(data, status, xhr) {
                if (status != 'success' || data.ret == 0) {
                    console.log("初始化 uuid 信息失败");
                } else {
                    console.log("Data: " + data.message + "\nStatus: " + status);
                    // 将数据写入 cookie 中
                }
            });

            // 初始化社交分享参数
            $.ajax({
                type: 'get',
                dataType: 'json',
                url: '/pana-BE-RESTful/wx/init',
                data: {
                    'currentUrl': location.href.split('#')[0]
                },
                success: function(data) {
                    window.myShareData = data.result;

                    if (window.myShareData) {
                        wx.config({
                            debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
                            appId: myShareData.appid, // 必填，公众号的唯一标识
                            timestamp: myShareData.timestamp, // 必填，生成签名的时间戳
                            nonceStr: myShareData.noncestr, // 必填，生成签名的随机串
                            signature: myShareData.signature, // 必填，签名，见附录1
                            jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage'] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
                        });

                        wx.ready(function() {
                            wx.onMenuShareTimeline({
                                title: titleText, // 分享标题
                                link: shareUrl,
                                imgUrl: imageUrl, // 分享图标
                                success: function() {},
                                cancel: function() {}
                            });

                            wx.onMenuShareAppMessage({
                                title: titleText, // 分享标题
                                desc: descriptionText, // 分享描述
                                link: shareUrl,
                                imgUrl: imageUrl, // 分享图标
                                success: function() {},
                                cancel: function() {}
                            });
                        });

                        wx.error(function(res) {
                            console.log(res);
                        });
                    }
                }
            });
        });
    </script>
</body>

</html>